<template>
	<div class="wrapper">
		<div class="dis" v-for="(item,index) in list" :key="index" @click="navUrl('/costPrice',item)">
			<div class="main">
				<div class="dia" style="justify-content: space-between;">
					<div class="">{{item.activityName}}</div>
					<div class="">
						<img src="@/assets/terminal/arrow_right_black.png" alt="" />
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import {
		selectActivityByChannel
	} from '@/api/terminal'
	import store from '@/store'
	import {
		showToast
	} from 'vant'
	export default defineComponent({
		name: 'sateActive',
		setup() {
			const router = useRouter()
			const routers = useRoute()
			const state = reactive({
				list: []
			})
			const navUrl = (e,item) => {
			   router.push({
				   path:e,
				   query:{
					   activityId:item.activityId,
					   channelCode:routers.query.channelCode
				   }
			   })
			}
			const getList = () => {
				console.log(routers.query)
				selectActivityByChannel({
					channelCode: routers.query.channelCode,
				}).then(res => {
					state.list = res.data
				})
			}
			getList()
			return {
				...toRefs(state),
				getList,
				navUrl
			}
		}
	})
</script>
<style scoped lang="scss">
	.wrapper {
		background: #F9FBFF;
		width: 100%;
		height: 100%;
		min-height: 100vh;
		.main {
			width: 92%;
			// height: 54px;
			background: #FFFFFF;
			border-radius: 6px;
			margin-top: 12px;
			padding: 18px 12px;
			box-sizing: border-box;
			img{
				width: 14px;
				height: 14px;
			}
		}
	}
</style>